<style tyle="text/css">
    .modal-lg {
        width: 80%;
    }
    .panel {
        margin-bottom: 0px;
    }
</style>
<div class="panel panel-default">
    <div class="modal-header">
        <h4 class="modal-title">城市列表</h4>
    </div>
    <div class="modal-body panel-body">
        <form name="form" class="form-horizontal form-validation ng-pristine ng-valid ng-valid-required">
            <table class="table table-striped table-bordered dataTable table-condensed tree_table" style="table-layout:fixed">
                <thead>
                    <tr>
                        <th class="text-center">补贴活动标识</th>
                        <th class="text-center">城市编号</th>
                        <th class="text-center">城市名称</th>
                        <th class="text-center">城市补贴活动总量</th>
                        <th class="text-center">城市补贴活动余量</th>
                        <th class="text-center">补贴活动状态</th>
                        <th class="text-center">操作</th>
                    </tr>
                </thead>
                <tbody>
                    <tr ng-repeat="city in cityList">
                        <td class="text-center">{{city.subsidy_id}}</td>
                        <td class="text-center" ng-dblclick="edit($index)">
                            <span ng-show="city.state">{{city.subsidy_city_code}}</span>
                            <input type="text" class="form-control" ng-model="city.subsidy_city_code" ng-show="!city.state">
                        </td>
                        <td class="text-center" ng-dblclick="edit($index)">
                            <span ng-show="city.state">{{city.subsidy_city_name}}</span>
                            <input type="text" class="form-control" ng-model="city.subsidy_city_name" ng-show="!city.state">
                        </td>
                        <td class="text-center" ng-dblclick="edit($index)">
                            <span ng-show="city.state || !city.is_new">{{city.subsidy_city_total}}</span>
                            <input type="number" class="form-control" ng-model="city.subsidy_city_total" ng-show="!city.state && city.is_new">
                        </td>
                        <td class="text-center" ng-dblclick="edit($index)">
                            <span ng-show="city.state || !city.is_new">{{city.subsidy_city_num}}</span>
                            <input type="number" class="form-control" ng-model="city.subsidy_city_num" ng-show="!city.state && city.is_new">
                        </td>
                        <td class="text-center" ng-dblclick="edit($index)">
                            <span ng-show="city.state && city.subsidy_city_state == '1'">未开始</span>
                            <span ng-show="city.state && city.subsidy_city_state == '2'">进行中</span>
                            <span ng-show="city.state && city.subsidy_city_state == '3'">已结束</span>
                            <select class="form-control" ng-model="city.subsidy_city_state" ng-show="!city.state">
                                <option value="1">未开始</option>
                                <option value="2">进行中</option>
                                <option value="3">已结束</option>
                            </select>
                        </td>
                        <td class="text-center">
                            <button type="button" class="btn btn-success btn-xs" ng-if="city.subsidy_city_state == '1' && !city.is_new" ng-click="start(city)">开{{cpmpany.is_new}}始</button>
                            <button type="button" class="btn btn-danger btn-xs" ng-if="city.subsidysubsidy_city_state_state == '2'" ng-click="end(city)">结束</button>
                            <button type="button" class="btn btn-info btn-xs" ng-if="!city.is_new" ng-click="save(city)">保存</button>
                            <button type="button" class="btn btn-info btn-xs" ng-if="city.is_new" ng-click="create(city)">确定</button>
                            <button type="button" class="btn btn-info btn-xs" ng-if="!city.is_new" ng-click="updateNum(city)">设置数量</button>
                        </td>
                    </tr>
                </tbody>
            </table>
        </form>
    </div>
    <div class="modal-footer">
        <a class="btn btn-md btn-success" ng-click="add()">添加城市</a>
    </div>

</div>
